# -*- coding: utf-8 -*-
import re
import maya.cmds as mc
from liberHook.BaseHook import BaseHook
from liberLibs.dccLibs import Maya
from liberLibs import utils


class Hook(BaseHook):
    def __init__(self, library, directory, ext, start, end):
        BaseHook.__init__(self, library, directory, ext, start, end)

    def execute(self):
        if not Maya.load_plugin("redshift4maya.mll"):
            self.append_error("Load redshift4maya.mll failed.")
            return
        if not self.files:
            self.append_error("No rs files found")
            return
        Maya.create_rs_proxy(self.files)
